﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Web.UI;
using System.Data.SqlClient;
using System.Web.UI.WebControls;
using BLL;
using Factory;

namespace test806
{
    public partial class WebForm2 : System.Web.UI.Page

    {
        private IOperateDBRepository lg = OperateDBFactory.InitializeOperateDBRepository();
       
        protected void Page_Load(object sender, EventArgs e)
        {
          


        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            

            //以下是报错语句
            string TextBox_input = TextBox1.Text;
      
            Role selectRoleIdResult = lg.GetRoleById(Convert.ToInt32(TextBox_input));
                
            if (selectRoleIdResult==null&&TextBox1.Text!="0")
            {
                Response.Write("<script>alert('RoleId not exist!')</script>");
            }
            else
            {
                string url;
                url = "WebForm1.aspx?roleid_trans=" + TextBox1.Text;
                Response.Redirect(url);
            }
            
        }
    }
}